<template>
	<view class="content">
		<view class="header">友邻社区</view>
		<view class="title">
			<image class="icon" src="../../../static/images/discover/huo.png"></image>
			为你推荐
		</view>
		<soroll-x :list="list"></soroll-x>
		<view class="title">
			<image class="icon" src="../../../static/images/neighbor/fenlei.png"></image>
			社区分类
		</view>
		<view class="module-list">
			<view class="item" v-for="item in moduleList" :key="item" @click="moduleClick(item)">
				<image class="item-image" :src="item.imgSrc" mode="widthFix"></image>
				<view class="item-title" v-text="item.title"></view>
			</view>
		</view>
		<view class="bottom-bow"></view>
	</view>
</template>

<script>
	import {
		neighborModel
	} from '../neighbor.js'
	import sorollX from '../../../components/community/scrollX.vue'
	const Neighbor = new neighborModel();
	export default {
		components:{
			sorollX
		},
		data() {
			return {
				list: [],
				moduleList: [{
					title: '小区活动',
					imgSrc: '../../../static/images/neighbor/huodong.png',
					Url: 'neighbor/activity/list.html',
					myUrl: 'neighbor/activity/my.html'
				}, {
					title: '小区拼车',
					imgSrc: '../../../static/images/neighbor/pinche.png',
					Url: 'neighbor/carSharing/list.html'
				}, {
					title: '二手之家',
					imgSrc: '../../../static/images/neighbor/ershou.png',
					Url: 'neighbor/secondHand/list.html',
					myUrl: 'neighbor/secondHand/my.html'
				}, {
					title: '业主分享',
					imgSrc: '../../../static/images/neighbor/fenxiang.png',
					Url: 'neighbor/share/list.html'
				}]
			}
		},
		onLoad() {
			const getData = Neighbor.getIndexData()
			getData.then((res) => {
				console.log(res)
				this.list = res
			})
		}
	}
</script>

<style lang="scss">
	@import '../../../common/scss/neighbor.scss';
</style>
